<?php

namespace App\Models\SystemManagement;

use App\Models\CommonModel;
use App\Models\Constant\Fields;
use Illuminate\Database\Eloquent\Model;

class PostSkill extends Model
{
    protected $table = 'post_skills';

    protected $guarded = [];
    protected $hidden = ['created_at','updated_at'];

    function skill(){
        return $this->belongsTo(Skill::class,Fields::SKILL_ID,Fields::ID)
            ->select('id','name');
    }

    function post(){
        return $this->belongsTo(Post::class,Fields::POST_ID,Fields::ID)->with(['department','organization']);
    }
}
